package com.example.april.service.impl;

import com.example.april.dao.CustomerDao;
import com.example.april.pojo.Customer;
import com.example.april.service.CustomerService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CustomerServiceImpl implements CustomerService {
    @Resource
    CustomerDao customerDao;

    public List<Customer> findAll(){
        List<Customer> customers = customerDao.selectList(null);
        return customers;
    }

    @Override
    public Customer update(String id) {
        return customerDao.selectById(id);
    }
    @Override
    public void subUpdate(Customer customer) {
        customerDao.updateById(customer);
    }

    @Override
    public void delete(String id) {
        customerDao.deleteById(id);
    }

    @Override
    public void insert(Customer customer) {
        customerDao.insert(customer);
    }

}
